﻿@{
    ViewBag.Title = "DefinedManager";
    Layout = null;
}
@model UcAsp.Net.Model.UserDefined
<script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste hr upfile"
            ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |link image upfile"

    });
    $(".save").click(function () {
        $.post("/Admin/SaveDefined", { DefinedName: $("input[name='DefinedName']").val(), DefinedTitle: $("input[name='DefinedTitle']").val(), DefinedDescription: $("input[name='DefinedDescription']").val(), DefinedView: $("#DefinedView").val(), DefinedHtml: tinyMCE.get("DefinedHtml").getContent() }, function (dataResult) {
            location.reload();
        })
    })
</script>
<form action="#" method="post">
<p>
    <label>
        自定义路径(只能用英文或数字)</label>
    <input class="text-input medium-input" type="text" id="DefinedName" name="DefinedName" value="@Model.DefinedName" />
</p>
<p>
    <label>
        自定义中文名</label>
    <input class="text-input medium-input" type="text" id="DefinedTitle" name="DefinedTitle" value="@Model.DefinedTitle" />
</p>
<p>
    <label>
        自定义描述</label>
    <input class="text-input medium-input" type="text" id="DefinedDescription" name="DefinedDescription" value="@Model.DefinedDescription" />
</p>
<p>
    <label>
        内容</label>
    <textarea id="DefinedHtml" name="DefinedHtml" cols="20" rows="2">@Model.DefinedHtml</textarea>
</p>
<p>
    <label>
        模板选择</label>
         @Html.DropDownListFor(m=>m.DefinedView, (SelectList)ViewData["selectlist"])
    
</p>
<p>
    <span class="btn btn-danger save"><i class= "icon-check icon-white"></i>保存</span>
</p>
</form>
